<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/tld/importTag.tld" prefix="importTag"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<%@ taglib uri="/WEB-INF/tld/pageutil.tld" prefix="pu"%>
<%@taglib uri="/WEB-INF/tld/mallutil.tld" prefix="mu" %>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@page import="org.apache.commons.lang.math.RandomUtils"%>
<%@page import="com.yaodian100.ec.category.entity.Category"%>
<%@page import="java.net.URLEncoder"%>
<c-rt:set var="frontContentHtmlPath" value='<%=ServerValue.getFrontContentHtmlPath()%>'/>
<c-rt:set var="frontHtmlPath" value='<%=ServerValue.getFrontApachePath()%>'/>
<c-rt:set var="hostName" value='<%=request.getServerName()%>'/>
<c-rt:set var="imgDomain" value='<%=ServerValue.getImgDomain()%>'></c-rt:set>
<script type="text/javascript" charset="UTF-8" src="/js/category.js"></script>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.flash.js"></script>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.random.js"></script>
<script type="text/javascript">
	$().ready(function(){		
		$("#main").attr("class","${category.templateId}");
		$(".clear-history").click(function(){
			$.post("/ecmall/product/jsonClearPV.do",{},clearPVCallback,"json");
		});
	});
	function clearPVCallback(clearPV){
		if ( clearPV == "true" ) $(".my-history > li").remove();
		$(".clear-history").hide();
		$(".my-history").append('<li class="no-recode">您没有任何记录</li>');
	}
</script>
<script type="text/javascript" src="${imgDomain}/js/rec.js">
{
	"mid":27,
	"pid":"cat${category.level+1}",
	"rcat":"${category.id}",
	"ch":"${category.id}",
	<c-rt:if test="${!empty mu:memberId()}">
	"uid":"${mu:memberId()}",
	</c-rt:if>
	"layout":"cat${category.level+1}"
	}
</script>
<script src="/js/jquery.lazyload.yaodian100.js"></script>
<script src="/js/yaodian100_lazyloadCateIndex.js"></script>
<%--art提供，作為館首頁熱搜精選圓標 IE6支援png透明 --%>
<!--[if lt IE 7]>
<script type="text/javascript" src="/js/unitpngfix.js"></script>
<![endif]-->
<input type="hidden" value="${imgDomain}" id="imageDomain" />
<jsp:include page="/common/collection.jsp"/>
<div class="tocollect">
	<a href="#" id="addCategoriesList_${category.id}" class="icon-collection">收藏此分类</a>
</div>
<div class="sidebar">
	<importTag:static path="${frontContentHtmlPath}${category.id}/SIDEBAR.html"/>
	<!-- 瀏覽記碌 -->
	 <div class="pd-sidebar">
      <ul class="my-history">
      	<c-rt:choose>
	      	<c-rt:when test="${empty mpvList}">
	      		<li class="no-recode">您没有任何记录</li>
	      	</c-rt:when>
	      	<c-rt:otherwise>
	      	<a href="###" class="clear-history">清除</a>
		        <c-rt:forEach items="${mpvList}" var="mpv" varStatus="index">
		        	<li class="${index.count eq fn:length(mpvList) ? 'lastone' :'' }">
		        		<a class="a-img" href="${frontendContextPath}/ecmall/product/product.do?productId=${mpv.productId}&hpp=history" target="_blank">
		        			<img width="50" height="50" alt="" src="${imgDomain}/PImg/${pu:substring(mpv.productId, 0,4) }/${mpv.productId }/${mpv.productId}_m50.jpg" onError="this.src='/PImg/blank_50.gif'">
		        		</a>
		        		<a class="pdname" href="${frontendContextPath}/ecmall/product/product.do?productId=${mpv.productId}&hpp=history" target="_blank">${mpv.productName}</a>
		        		<strong>￥ <fmt-rt:formatNumber value="${mpv.shelfPrice}"  pattern="####0.0"/></strong>
		        	</li>
		        </c-rt:forEach>
	      	</c-rt:otherwise>
      	</c-rt:choose>
     	</ul>
    </div> 
	<div class="sb-brand">
		<importTag:static path="${frontHtmlPath}/pages/BRAND/${category.id}.html"/>
 	</div>
 	<c-rt:if test="${fn:endsWith(hostName, 'yaodian100.com')}">
	  <div class="ad-sky">
	  	<script type="text/javascript">
				GA_googleFillSlot("yd100_${tempZId}_sidebar_right_image_01");
			</script>
	  </div>
	  <div class="lt-bn-end">
	  	<script type="text/javascript">
				GA_googleFillSlot("yd100_${tempZId}_sidebar_right_image_02");
				GA_googleFillSlot("yd100_${tempZId}_sidebar_right_image_03");
			</script>
	  </div>
  	</c-rt:if>
</div>
<div class="content">
	<c-rt:if test="${fn:endsWith(hostName, 'yaodian100.com')}">
		<div class="ad-leader">
			<script type="text/javascript">
				GA_googleFillSlot("yd100_${tempZId}_upper_image_01");
			</script>
		</div>
	</c-rt:if>
	<c-rt:set var="mainGoldNum"><%=RandomUtils.nextInt(3)+1%></c-rt:set>
	<c-rt:set var="mainGold"><importTag:static path="${frontContentHtmlPath}${category.id}/000_MAINGOLD_V2_${mainGoldNum}.html"/></c-rt:set>
	<c-rt:choose>
		<c-rt:when test="${not empty mainGold}">${mainGold}</c-rt:when>
		<c-rt:otherwise>
			<importTag:static path="${frontContentHtmlPath}${category.id}/000_MAINGOLD_V2_1.html"/>
		</c-rt:otherwise>
	</c-rt:choose>
  <importTag:static path="${frontContentHtmlPath}${category.id}/HOTSELECT_V2.html"/>
  <c-rt:if test="${fn:endsWith(hostName, 'yaodian100.com')}">
  <div class="barmid">
  	<div class="bn-1">
  	<script type="text/javascript">
		 		GA_googleFillSlot("yd100_${tempZId}_twinsnew_image_01");
		</script>
		</div>
		<div class="bn-2">
  	<script type="text/javascript">
		 		GA_googleFillSlot("yd100_${tempZId}_twinsnew_image_02");
		</script>
		</div>
  </div>
  </c-rt:if>
	<importTag:static path="${frontContentHtmlPath}${category.id}/SPECIALACT.html"/>
</div>